package com.plan.dao.service.card.impl;

import com.plan.controller.card.request.PointProductPageListReq;
import com.plan.controller.card.response.PointProductListRes;
import com.plan.dao.mapper.card.PointProductMapper;
import com.plan.dao.service.card.PointProductDaoService;
import com.plan.entity.card.PointProduct;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PointProductDaoServiceImpl implements PointProductDaoService {
    @Resource
    private PointProductMapper pointProductMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insert(PointProduct p) {
        return pointProductMapper.insert(p);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int update(PointProduct p) {
        return pointProductMapper.update(p);
    }

    @Override
    public int delete(Long teamId, Long id) {
        return pointProductMapper.delete(teamId, id);
    }

    @Override
    public List<PointProductListRes> getPageList(PointProductPageListReq req) {
        return pointProductMapper.getPageList(req);
    }

    @Override
    public PointProduct getOneById(Long teamId, Long id) {
        return pointProductMapper.getOneById(teamId, id);
    }


}
